/**
 * @author Nicolas Lusa (lusan@usi.ch)
 */
package ch.usi.inf.pf2.gui.tool;

import java.awt.event.MouseEvent;

import ch.usi.inf.pf2.circuit.NandGate;
import ch.usi.inf.pf2.gui.Model;

public final class NandGateCreationTool extends Tool {

    public NandGateCreationTool(final Model model) {
        super(model, "Select this tool and click on the canvas to create a NAND gate.", "../icons/nand.png", "../icons/nandBg.png");
    }
    
    public void mouseClicked(final MouseEvent ev) {
        final NandGate nand = new NandGate(ev.getX(), ev.getY());
        getCircuit().add(nand);
        getSelection().clear();
        getSelection().add(nand);
    }

}